package com.itheima.service.impl;

import com.itheima.mapper.UserMapper;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
public class UserServiceImpl implements UserService {
    @Autowired
    public UserMapper userMapper;
@Transactional
    public void moveMoney(String name1, String name2, double money) {
        userMapper.inAccount(name1,money);
        int i=1/0;
        userMapper.outAccount(name2,money);
    }
}
